<template>
<<<<<<< HEAD
    <van-tabbar active-color="#07c160" v-model="act" @change="onChange" class="van-hairline--top">
        <van-tabbar-item name="home" icon="home-o">主页</van-tabbar-item>
        <van-tabbar-item name="search" icon="newspaper-o">机构信息</van-tabbar-item>
        <van-tabbar-item name="mes" icon="chat-o" info="5">消息</van-tabbar-item>
        <van-tabbar-item name="friends" icon="friends-o">个人信息</van-tabbar-item>
    </van-tabbar>
</template>

<script>
import { 
    Tabbar, 
    TabbarItem ,
    Icon 
} from 'vant';
export default {
    name: 'footerBtn',
    components: {
        [Tabbar.name]:Tabbar,
        [Icon.name]:Icon,
        [TabbarItem.name]:TabbarItem,
    },
    props:{
        active: {
            type: String,
            default: "home"
        },
    },
    data () {
        return {
            act:'home'
        }
    },
    created(){
        this.act = this.active
    },
    methods:{
        onChange(val){
            console.log(val)
            if(val == 'mes'){
                this.$router.push({path: '/message'});
            }  
            if(val == 'home'){
                this.$router.push({path: '/govIndex'});
            }
        }
    }
}
=======
  <van-tabbar active-color="#07c160" v-model="act" @change="onChange" class="van-hairline--top">
    <van-tabbar-item name="home" icon="home-o">主页</van-tabbar-item>
    <van-tabbar-item name="search" icon="newspaper-o">机构信息</van-tabbar-item>
    <van-tabbar-item name="mes" icon="chat-o" :info="num" id="v-step-3">消息</van-tabbar-item>
    <van-tabbar-item name="friends" icon="friends-o">个人信息</van-tabbar-item>
  </van-tabbar>
</template>

<script>
import { Tabbar, TabbarItem, Icon } from "vant";
import { getMessage } from "@/api/gov/message";
export default {
  name: "footerBtn",
  components: {
    [Tabbar.name]: Tabbar,
    [Icon.name]: Icon,
    [TabbarItem.name]: TabbarItem
  },
  props: {
    active: {
      type: String,
      default: "home"
    }
  },
  data() {
    return {
      act: "home",
      num: 0
    };
  },
  created() {
    this.act = this.active;
    getMessage({
      fopenid: "ainiaini"
    }).then(res => {
      this.num = res.list.length;
    });
  },
  methods: {
    onChange(val) {
      if (val == "mes") {
        this.$router.push({ path: "/message" });
      }
      if (val == "home") {
        this.$router.push({ path: "/govIndex" });
      }
    }
  }
};
>>>>>>> zcm
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style>
<<<<<<< HEAD

=======
>>>>>>> zcm
</style>
